﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Ras2Form
{
    public partial class MainWindow : Form
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void OnNewItem(object sender, EventArgs e)
        {
            switch (m_tabMain.SelectedIndex)
            {
                case 0: m_view1.OnNewHitList(); break;
                case 1: m_view2.OnNewSong(); break;
                case 2: m_view3.OnNewPerformer(); break;
            }
        }

        private void OnEditItem(object sender, EventArgs e)
        {
            switch (m_tabMain.SelectedIndex)
            {
                case 0: m_view1.OnEditHitList(); break;
                case 1: m_view2.OnEditSong(); break;
                case 2: m_view3.OnEditPerformer(); break;
            }
        }

        private void OnDeleteItem(object sender, EventArgs e)
        {
            switch (m_tabMain.SelectedIndex)
            {
                case 0: m_view1.OnDeleteHitList(); break;
                case 1: m_view2.OnDeleteSong(); break;
                case 2: m_view3.OnDeletePerformer(); break;
            }
        }

        // Um forritið
        private void OnHelpAbout(object sender, EventArgs e)
        {
            About dlg = new About();
            dlg.ShowDialog();
        }

        // Hætta í forriti
        private void OnFileExit(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void m_tsAbout_Click(object sender, EventArgs e)
        {
            OnHelpAbout(null, null);
        }
    }
}
